package com.yeqiangwei.commons.mail;

import com.yeqiangwei.commons.mail.exception.MailException;

public class MailTest {
	
	public static void main(String args[]){
		MailConfig config = new MailConfig();
		config.setSmtpAccount("waf903@163.com");
		config.setSmtpPassword("15522883276");
		config.setSmtpNeedPassword(true);
		config.setSmtpNeedSSL(false);
		config.setSmtpPort("25");
		config.setSmtpServer("smtp.163.com");
		MailEntity entity = new MailEntity();
		entity.setFrom("waf903@163.com");
		entity.setTo("gamvan@163.com");
		entity.setSender("今晚在线");
		entity.setSubject("很想看见你阿!!!");
		entity.setHtmlText("如题<br/><br/><a href=\"http://www.kedou.com\">少年壮志不言愁，www.Kedou.com</a>");
		MailService mailService = new MailService();
		try {
			mailService.sendMail(mailService.getSession(config), entity);
		} catch (MailException e) {
			e.printStackTrace();
		}
	}
	
}
